﻿@page "/scheduler/hide-non-working-days"

@using Syncfusion.Blazor.Schedule
@inherits SampleBaseComponent;

<SampleDescription>
   <p>This demo depicts the way to show or hide the weekend days of a week on Scheduler. The days whichever not specified in working days collections will be taken into consideration as weekend days.</p> 
</SampleDescription>
<ActionDescription>
   <p> In this demo, the <code>ShowWeekend</code> property is used either to show or hide the weekend days of a week and it is not applicable on <code>Workweek</code> view. By default, it is set to
     <code>true</code>. The days which are not a part of the working days collection of a Scheduler are usually considered as weekend days here.</p>
   <p>Here, the working days are defined as <code>[1, 3, 4, 5]</code> on Scheduler. Therefore, the remaining days (0, 2, 6 - Sunday, Tuesday and Saturday) are considered as weekend days and will be hidden from the views as the <code>ShowWeekend</code> property is set to false.</p>
</ActionDescription>

<div class="control-section">
    <div class="schedule-wrapper">
        <SfSchedule TValue="ScheduleData.AppointmentData" Width="100%" Height="650px" @bind-SelectedDate="@CurrentDate" ShowWeekend="false" WorkDays="@WorkDays">
            <ScheduleWorkHours Start="08:00"></ScheduleWorkHours>
            <ScheduleViews>
                <ScheduleView Option="View.Day"></ScheduleView>
                <ScheduleView Option="View.Week"></ScheduleView>
                <ScheduleView MaxEventsPerRow="2" Option="View.Month"></ScheduleView>
                <ScheduleView Option="View.WorkWeek"></ScheduleView>
                <ScheduleView MaxEventsPerRow="13" Option="View.TimelineMonth"></ScheduleView>
            </ScheduleViews>
            <ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>
        </SfSchedule>
    </div>
</div>

@code{
    private DateTime CurrentDate = new DateTime(2020, 1, 16);
    public List<ScheduleData.AppointmentData> DataSource = new ScheduleData().GetEmployeeEventData();
    static int[] WorkDays = new int[] { 1, 3, 4, 5 };
}